public class index {
    public String convert(String s, int numRows) {
        int len = s.length();
        char[] arr1 = s.toCharArray();
        int num = numRows + numRows - 2;
        int count = 0;
        String ret = "";
        if (numRows == 1) {
            return s;
        }
        while (count < numRows) {
            int count1 = 0;
            for (int i = 0; i < len; i++) {
                if (i % num == count || i % num == num - count) {
                    ret += arr1[i];
                }
            }
            count++;
        }
        return ret;
    }
}
